-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementations of is_contiguous
and make_contiguous
#522
Conversation
Here is a pre-built version of the code in this pull request: wheels.zip, you can install it locally by unzipping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good so far @SanggyuChong , nice job!
I've requested a few changes below. You'll notice on the PR that the build failed - this is because of a linting error. You can use tox -e lint
and tox -e format
to run the linter and formatter respectively to make sure changes to the code adhere to the style guides in metatensor.
After you've made these changes, let's discuss how to make a metatensor-torch version of this function - probably best done in person.
python/metatensor-operations/metatensor/operations/_dispatch.py
Outdated
Show resolved
Hide resolved
python/metatensor-operations/metatensor/operations/contiguous.py
Outdated
Show resolved
Hide resolved
python/metatensor-operations/metatensor/operations/contiguous.py
Outdated
Show resolved
Hide resolved
python/metatensor-operations/metatensor/operations/contiguous.py
Outdated
Show resolved
Hide resolved
python/metatensor-operations/metatensor/operations/contiguous.py
Outdated
Show resolved
Hide resolved
python/metatensor-operations/metatensor/operations/contiguous.py
Outdated
Show resolved
Hide resolved
python/metatensor-operations/metatensor/operations/contiguous.py
Outdated
Show resolved
Hide resolved
Also, if you look at the documentation build here: https://metatensor--522.org.readthedocs.build/en/522/ and navigate to the operations you'll see that these operations aren't yet there. In general 'documentation' in the checklist at the top of this PR covers all of comments, docstrings, API docs, and tutorials - where necessary and appropriate. In this case we'll need an API reference but will have to manually do that - we can discuss this too in the next step! |
What's the status on this PR? |
The status is that it has been lost to the bottom of the priority list - will finish it off at some point but happy for you to close for now if you like :) |
Do you remember what's missing? I can also quickly take over and finish it |
I think it was almost there but I remember not being able to make the trochscript tests work for a reason I didn't get to the bottom of |
…nd write tests for them
… opeartions. Add docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Guillaume!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I would only link to the docs of numpy and torch at a good place for reference.
In this PR, we attempt to roll out python-based functions that allow one to check whether or not the values in a
TensorBlock
andTensorMap
are contiguous, and make them contiguous as needed. Tests for the newly implemented operations have also been implemented.Resolves #265
Contributor (creator of pull-request) checklist
Reviewer checklist
📚 Documentation preview 📚: https://metatensor--522.org.readthedocs.build/en/522/
📚 Download documentation preview for this pull-request